﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GOCS
{
    public class GObject
    {

        public Dictionary<String, GComponent> _ComponentList = new Dictionary<String, GComponent>();

        public uint _ID;

        public T getComponent<T>()
        {
            
            GComponent component;

            if (_ComponentList.TryGetValue(typeof(T).Name, out component))
            {
                return (T) (object)component;
            }

            return default(T);
        }

        public GComponent SetComponent(GComponent newComp)
        {

            _ComponentList.Add(newComp.GetCompType(), newComp);
            newComp._Owner = this;
            return newComp;
        }

	}


}
